package com.itheima.zuoye.zuoye2;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public class Test {
    public static void main(String[] args) {
        HashMap<Integer, String> map = new HashMap<>();
        map.put(101, "阿三面馆");
        map.put(102, "阿三粥馆");
        map.put(103, "阿三米馆");
        map.put(104, "阿三快递");
        map.forEach((k,v)-> System.out.println(k+"--"+v));
        System.out.println("===========================");
        Set<Integer> keys = map.keySet();
        for (Integer key : keys) {
            String value = map.get(key);
            System.out.println(key + "--" + value);
        }
        System.out.println("===========================");
        Set<Map.Entry<Integer, String>> entrySet = map.entrySet();
        for (Map.Entry<Integer, String> integerStringEntry : entrySet) {
            System.out.println(integerStringEntry.getKey() + "--" + integerStringEntry.getValue());
        }
    }
}
